<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
/*
 * 		继承发展史
 * 		1.传统形式 -->原型链 过多的继承了没用的属性
 * 		2.借用构造函数-->不能集成借用构造函数的原型，每次构造函数都要多走一个函数
 * 		3.共享原型-->不能随便改动自己的原型
 * 		4.圣杯模式
 */
		
		
		
		/*//2.借用构造函数
		function Person(name,age,sex){
			this.name = name;
			this.age = age;
			this.sex = sex;
		}
		
		function Student(name,age,sex,grande){
			Person.call(this.name,age,sex);
			this.grande = grande;
		}*/
		
		/*//3.共享原型
		Father.prototype.lastName = "Deng";
		function Father(){
		}
		function Son(){
		}
		Son.prototype = Father.prototype;
		var son = new Son();
		var father = new Father();*/
		
		/*Father.prototype.lastName = "Deng";
		function Father(){}
		function Son(){}
		function inherit(Origin,Target){
			Target.prototype = Origin.prototype;
		}
		inherit(Father,Son);
		var son = new Son();
		var father = new Father();*/
		
/*		//圣杯模式
		function F(){}
		F.prototype = Father.prototype;
		Son.prototype = new F();*/
		
		Father.prototype.lastName = "Deng";
		function Father(){}
		function Son(){}
		function inherit(Origin,Target){
			function F(){}
			F.prototype = Origin;
			Target.prototype = new F();
			Target.prototype.constructor = Target;
			Target.prototype.uber = Origin.prototype;
		}
		
		
		
			
			
			
			
		</script>
		
	</body>
</html>
